var util = require("util");

// define an object
function Person(){
    this.name = "HugoHoo";
    this.getName = function(){
        return this.name;
    }
}

var obj = new Person();

// util.inspect(), translate obj to string
console.log(util.inspect(obj, false, null, true));
console.log(util.inspect(obj, true, null, true));